using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLBH
{
public class tblCaLamViecUI
{ 
	private int idCaLamViec;
	public int IdCaLamViec
	{
		get { return idCaLamViec;}
		set { idCaLamViec = value;}
	}

	private String gioBatDauLamViec;
	public String GioBatDauLamViec
	{
		get { return gioBatDauLamViec;}
		set { gioBatDauLamViec = value;}
	}

	private String gioKetThucLamViec;
	public String GioKetThucLamViec
	{
		get { return gioKetThucLamViec;}
		set { gioKetThucLamViec = value;}
	}

	public tblCaLamViecUI() {}

	public tblCaLamViecUI(int idCaLamViec, String gioBatDauLamViec, String gioKetThucLamViec)
	 {
		this.idCaLamViec = idCaLamViec;
 		this.gioBatDauLamViec = gioBatDauLamViec;
 		this.gioKetThucLamViec = gioKetThucLamViec;
 	}

	public int Add(String gioBatDauLamViec, String gioKetThucLamViec)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_Add",gioBatDauLamViec,gioKetThucLamViec);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idCaLamViec, String gioBatDauLamViec, String gioKetThucLamViec)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_Update",idCaLamViec,gioBatDauLamViec,gioKetThucLamViec);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idCaLamViec)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_Delete",idCaLamViec);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idCaLamViec)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblCaLamViec_Get",idCaLamViec);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblCaLamViec_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
